<%--
  Created by IntelliJ IDEA.
  User: Wonderming
  Date: 2018/4/16
  Time: 11:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false"%>
<link type="text/css" rel="stylesheet" href="css/common/common.css"/>

<div class="animated fadeInRight">
    <div class="wrapper wrapper-content ng-scope">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox float-e-margins">
                     <div class="ibox-title">
                         <h5>{{ 'OUTER' | translate }}</h5>
                     </div>

                     <div class="ibox-content sk-loading" ng-controller="riskOuterCtrl">
                         <div class="sk-spinner sk-spinner-wave">
                             <div class="sk-rect1"></div>
                             <div class="sk-rect2"></div>
                             <div class="sk-rect3"></div>
                             <div class="sk-rect4"></div>
                             <div class="sk-rect5"></div>
                         </div>

                         <form name="myform" serializer="searchOuter(data)">
                              <div class="row">
                                  <!--类型-->
                                  <div class="col-sm-6 col-md-4 col-lg-1-5">
                                      <div class="form-group form-group-sm">
                                          <div class="input-group">
                                              <span class="input-group-addon">类型：</span>
                                              <select id="outer_type" name="outer_type" class="form-control" ng-model="outer.refTypeName">
                                                  <option value=""></option>
                                                  <option value="通用">通用</option>
                                                  <option value="收单机构">收单机构</option>
                                                  <option value="商户">商户</option>
                                                  <option value="域名">域名</option>
                                              </select>
                                          </div>
                                      </div>
                                  </div>
                                  <!--名称-->
                                  <div class="col-sm-6 col-md-4 col-lg-1-5">
                                      <div class="form-group form-group-sm">
                                          <div class="input-group" ng-show="outer.refTypeName != '通用' && outer.refTypeName != '收单机构' && outer.refTypeName != '商户' && outer.refTypeName != '域名'">
                                              <span class="input-group-addon">名称: </span>
                                              <select class="form-control" ng-model="outer.refName">
                                                  <option value="">{{ Name }}</option>
                                              </select>
                                          </div>
                                          <div class="input-group" ng-show="outer.refTypeName == '通用'">
                                              <span class="input-group-addon">名称: </span>
                                              <select class="form-control" ng-model="outer.refName">
                                                  <option value="">{{ Name }}</option>
                                              </select>
                                          </div>
                                          <div class="input-group" ng-show="outer.refTypeName == '收单机构'">
                                              <span class="input-group-addon">名称: </span>
                                              <select class="form-control" ng-model="outer.refName" ng-options="x.name as x.name for x in init.acquirer">
                                                  <option value="">{{ Name }}</option>
                                              </select>
                                          </div>
                                          <div class="input-group" ng-show="outer.refTypeName == '商户'">
                                              <span class="input-group-addon">名称: </span>
                                              <select class="form-control" ng-model="outer.refName" ng-options="x.name as x.id + '(' + x.name + ')' for x in init.merchant">
                                                  <option value="">{{ Name }}</option>
                                              </select>
                                          </div>
                                          <div class="input-group" ng-show="outer.refTypeName == '域名'">
                                              <span class="input-group-addon">名称：</span>
                                              <select class="form-control" ng-model="outer.refName" ng-options="x.siteUrl as x.siteUrl for x in init.siteurl">
                                                  <option value="">{{ Name }}</option>
                                              </select>
                                          </div>
                                      </div>
                                  </div>
                                  <!--规则元素-->
                                  <div class="col-sm-6 col-md-4 col-lg-1-5">
                                      <div class="form-group form-group-sm">
                                          <div class="input-group">
                                              <span class="input-group-addon">规则元素：</span>
                                              <select id="outer_role" name="outer_role" class="form-control" ng-model="outer.riskType " ng-options="x.name as x.name for x in extrisk">
                                              </select>
                                          </div>
                                      </div>
                                  </div>
                                  <!--状态-->
                                  <div class="col-sm-6 col-md-4 col-lg-1-5">
                                      <div class="form-group form-group-sm">
                                          <div class="input-group">
                                              <span class="input-group-addon">状态：</span>
                                              <select id="outer_state" name="outer_state" class="form-control" ng-model="outer.statusName" ng-options="x.name as x.name for x in statusConstant">
                                              </select>
                                          </div>
                                      </div>
                                  </div>
                                  <!--创建人-->
                                  <div class="col-sm-6 col-md-4 col-lg-1-5">
                                      <div class="form-group form-group-sm">
                                          <div class="input-group">
                                              <span class="input-group-addon">创建人：</span>
                                              <input type="text" id="outer_founder" name="outer_founder" class="form-control" name="founder" ng-model="outer.creator">
                                          </div>
                                      </div>
                                  </div>
                                  <!--最后修改人-->
                                  <div class="col-sm-6 col-md-4 col-lg-1-5">
                                      <div class="form-group form-group-sm">
                                          <div class="input-group">
                                              <span class="input-group-addon">最后修改人：</span>
                                              <input type="text" id="outer_modifier" name="outer_modifier" class="form-control" name="modifier" ng-model="outer.modifier ">
                                          </div>
                                      </div>
                                  </div>
                              </div>
                              <div class="row">
                                  <div class="col-sm-6 col-md-6 col-lg-3 col-lg-offset-3">
                                      <button  type="submit" class="btn btn-sm btn-w-m btn-primary pull-right" ng-click="search(outer)">
                                          查询
                                      </button>
                                  </div>
                                  <div class="col-sm-6 col-md-6 col-lg-3">
                                      <button class="btn btn-sm btn-w-m btn-info" ng-click="resetForm()">
                                          重置
                                      </button>
                                  </div>
                              </div>
                         </form>

                         <div class="hr-line-dashed"></div>

                         <button  type="button"  class="btn btn-sm  btn-primary" ng-click="showModal(row,0)">新增</button>

                         <div class="table-responsive">
                             <table ng-table="outerTable" class="table table-condensed table-striped table-hover table-bordered">
                                 <tr ng-repeat="row in $data">
                                     <td class="text-center" style="line-height: 2" data-title="''">
                                         <input type="checkbox" id="outerCheckBoxID" ng-model="outerCheckBox" ng-click="collectSelectRows($event,row.id)"/>
                                     </td>

                                     <td class="text-center" style="line-height: 2" data-title="'名称'">
                                          {{ row.refName }}
                                     </td>

                                     <td class="text-center" style="line-height: 2" data-title="'类型'">
                                          {{ row.refTypeName }}
                                     </td>

                                     <td class="text-center" style="line-height: 2" data-title="'风控类型'">
                                          {{ row.riskType }}
                                     </td>

                                     <td class="text-center" style="line-height: 2" data-title="'元素键值'">
                                          {{ row.elementValue }}
                                     </td>

                                     <td class="text-center" style="line-height: 2" data-title="'状态'">
                                          {{ row.statusName }}
                                     </td>

                                     <td class="text-center" style="line-height: 2" data-title="'创建人'">
                                          {{ row.creator }}
                                     </td>

                                     <td class="text-center" style="line-height: 2" data-title="'创建时间'">
                                          {{ row.createTime | date: 'yyyy-MM-dd hh:mm:ss' }}
                                     </td>

                                     <td class="text-center" style="line-height: 2" data-title="'最后修改人'">
                                          {{ row.modifier }}
                                     </td>

                                     <td class="text-center" style="line-height: 2" data-title="'修改时间'">
                                          {{ row.modifyTime | date: 'yyyy-MM-dd hh:mm:ss' }}
                                     </td>

                                     <td class="text-center" style="line-height: 2" data-title="'备注'">
                                          {{ row.remark }}
                                     </td>

                                     <td class="text-center" style="line-height: 2;max-width: 100px;" data-title="'操作'">
                                            <outerrisk-locked></outerrisk-locked>
                                     </td>
                                 </tr>
                             </table>
                         </div>
                         <my-pagination table-param="outerTable"></my-pagination>
                         <button class="btn btn-sm btn-primary del-btn marginTop-minus" ng-click="batchDel()" ng-disabled="deleteFlag">删除</button>
                     </div>
                </div>
            </div>
        </div>
    </div>
</div>

